﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ThirdServices.AlertModel.Factory;
using ThirdServices.AlertModel.Factory.BaseInterface;
using ThirdServices.AlertModel.Norway;
using ThirdServices.AlertModel.Providers.Norway.Verifiers;

namespace ThirdServices.AlertModel.Providers.Norway.Factory
{
    public class NorwayAlerts : AlertBaseFactory
    {
        public IAlert CreateAlert(AlertTypes alert)
        {
            IAlert ialert = null;
            switch (alert)
            {
                case AlertTypes.WindAlert:
                    ialert = new NorwayWindAlert();
                    //((NorwayWindAlert)ialert).
                    break;
                case AlertTypes.TempAlert:
                    ialert = new NorwayTempAlert();
                    break;
            }
            return ialert;
        }

        public IAlert CreateTemperatureAlert(double lat, double lon, double percentage, int periodInDays)
        {
            IAlert ialert = null;
            ialert = new NorwayTempAlert();
            ((NorwayTempAlert)ialert).Percentage = percentage;
            ((NorwayTempAlert)ialert).PeriodInDays = periodInDays;
            ((NorwayTempAlert)ialert).Lat = lat;
            ((NorwayTempAlert)ialert).Lon = lon;
            ((NorwayTempAlert)ialert).NumDataPerDay = 8;
            return ialert;
        }

        public IAlert CreateWindAlert(double lat, double lon, double radius)
        {
            IAlert ialert = null;
            ialert = new NorwayWindAlert();
            ((NorwayWindAlert)ialert).Lat = lat;
            ((NorwayWindAlert)ialert).Lon = lon;
            ((NorwayWindAlert)ialert).Radius = radius;
            return ialert;
        }

        public IAlert CreatePressureAlert(double lat, double lon, double delta, double radius)
        {
            IAlert ialert = null;
            ialert = new NorwayPressureVerifier();
            ((NorwayPressureVerifier)ialert).Lat = lat;
            ((NorwayPressureVerifier)ialert).Lon = lon;
            ((NorwayPressureVerifier)ialert).Delta = delta;
            ((NorwayPressureVerifier)ialert).Radius = radius;
            return ialert;
        }

        public IAlert CreateFogAlert(double lat, double lon, double delta, double radius)
        {
            IAlert ialert = null;
            ialert = new NorwayFogVerifier();
            ((NorwayFogVerifier)ialert).Lat = lat;
            ((NorwayFogVerifier)ialert).Lon = lon;
            ((NorwayFogVerifier)ialert).Radius = radius;
            ((NorwayFogVerifier)ialert).Delta = delta;
            return ialert;
        }

        public IAlert CreateHumidityAlert(double lat, double lon, double delta, double radius)
        {
            IAlert ialert = null;
            ialert = new NorwayHumidityVerifier();
            ((NorwayHumidityVerifier)ialert).Lat = lat;
            ((NorwayHumidityVerifier)ialert).Lon = lon;
            ((NorwayHumidityVerifier)ialert).Delta = delta;
            ((NorwayHumidityVerifier)ialert).Radius = radius;
            return ialert;
        }

        public IAlert CreateEarthquakeAlert(int pointsMax, double latMax, double latMin, double lonMax, double lonMin)
        {
            throw new System.NotImplementedException();
        }

        public IAlert CreateGlobalAlert(double lat, double lon, double radius)
        {
            throw new NotImplementedException();
        }
    }
}